from pymongo import MongoClient
from config import MONGO_DB_SERVER, MONGO_DB_PWD, MONGO_DB_USER


def get_mongodb(db_name='admin'):
    conn = MongoClient(MONGO_DB_SERVER)
    db = conn[db_name]
    db.authenticate(MONGO_DB_USER, MONGO_DB_PWD)
    return db
